home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
pascal
/
tegl6b.zip
/
INTROPAK.EXE
/
lha
/
TSTPICK2.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-05-05
|
3KB
|
115 lines
{$M 20000,0,655360}
{-- Defaults }
{$A-} {-- A- byte alignment }
{$B-} {-- B- short circuit boolean evaluation }
{$D+} {-- D- No debug info }
{$E-} {-- E- No emulation }
{$F-} {-- F- Far calls only when necessary }
{$I-} {-- I- I/O error checking done internally }
{$L+} {-- L- No local symbols }
{$N-} {-- N- Software reals }
{$R-} {-- R- Range checking off }
{$S-} {-- S- Stack overflow off }
{$V-} {-- V- No strict type checking }
uses virtmem,
errorlog,
teglfont,
teglmain,
tegledit,
tgraph,
teglintr,
teglmenu,
teglpick,
teglunit,
fastgrph;
var pickeditem : string;
pickedms : msclickptr;
pickedfs : imagestkptr;
{$F+}
Function ExitOption(fs:ImageStkPtr; ms: MsClickPtr) : Word;
{$F+}
BEGIN
Abortexit(pickeditem);
exitoption := 1;
END;
{$F+}
function droppicklist(fs:ImageStkPtr; Userkey:word; Var DataArea):Word;
{$F-}
var picklist : optionmptr absolute DataArea;
begin
dropoptionmenu(picklist);
droppicklist := 0;
END;
{$F+}
Function dropitems(fs:ImageStkPtr; ms: MsClickPtr) : Word;
{$F+}
var picklist : optionmptr;
begin
getuserdataarea(fs,222,picklist);
detachpicklist(picklist);
deletePickItem(picklist,random(picklist^.numofentries)+1);
deletePickItem(picklist,random(picklist^.numofentries)+1);
deletePickItem(picklist,random(picklist^.numofentries)+1);
deletePickItem(picklist,random(picklist^.numofentries)+1);
attachpicklist(picklist,random(picklist^.numofentries)+1);
beep(500,4,50);
dropitems := 1;
end;
{$F+}
Function Additems(fs:ImageStkPtr; ms: MsClickPtr) : Word;
{$F+}
var picklist : optionmptr;
begin
getuserdataarea(fs,222,picklist);
detachpicklist(picklist);
insertPickItem(picklist,random(picklist^.numofentries)+1,'item one on list',Additems,pickeditem);
insertPickItem(picklist,random(picklist^.numofentries)+1,'item two on list',dropitems,pickeditem);
insertPickItem(picklist,random(picklist^.numofentries)+1,'item three on list',Additems,pickeditem);
insertPickItem(picklist,random(picklist^.numofentries)+1,'item four on list',dropitems,pickeditem);
insertPickItem(picklist,random(picklist^.numofentries)+1,'item five on list',Additems,pickeditem);
insertPickItem(picklist,random(picklist^.numofentries)+1,'item six on list',dropitems,pickeditem);
insertPickItem(picklist,random(picklist^.numofentries)+1,'item seven on list',additems,pickeditem);
attachpicklist(picklist,random(picklist^.numofentries)+1);
beep(500,4,50);
Additems := 1;
end;
procedure testpicklist;
var x,y,x1,y1 : word;
picklist : optionmptr;
begin
x := 100;
y := 100;
x1 := x+200;
y1 := y+200;
pushimage(x,y,x1,y1);
shadowbox(x,y,x1,y1);
picklist := createpicklist(@font14);
DefinePickItem(picklist,'item one on list',Additems,pickeditem);
DefinePickItem(picklist,'item two on list',dropitems,pickeditem);
setuserdataarea(stackptr,222,picklist,droppicklist);
definepicklistarea(stackptr,10,10,3,5,picklist);
end;
begin
EasyTegl;
EasyOut;
testpicklist;
TEGLSupervisor;
end.